package com.hmall.cart;

import com.hmall.api.client.ItemClient;
import com.hmall.api.config.ClientFallbackFactoryConfig;
import com.hmall.api.config.DefaultFeignConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@MapperScan("com.hmall.cart.mapper")
@ConfigurationPropertiesScan(basePackages = "com.hmall.cart.config")
@EnableFeignClients(clients = {ItemClient.class}, defaultConfiguration = {DefaultFeignConfig.class, ClientFallbackFactoryConfig.class})
@SpringBootApplication
public class CartApplication {
    public static void main(String[] args) {
        SpringApplication.run(CartApplication.class, args);
    }

//    @Bean
//    public RestTemplate restTemplate() {
//        return new RestTemplate();
//    }
}
